package common.dynamic;

/**
 * 70. 爬楼梯
 */
public class _70_ClimbStairs {
    public int climbStairs(int n) {
        int r = 1;
        int p1 = 0;
        int p2 = 0;
        for (int i = 0; i < n; i++) {
            p1 = p2;
            p2 = r;
            r = p1 + p2;
        }
        return r;
    }
}
